package com.mdinic.blogovi.front.page;

import org.apache.wicket.Session;
import org.apache.wicket.protocol.http.WebSession;
import org.apache.wicket.request.Request;

import com.mdinic.blogovi.model.BlogType;
import com.mdinic.blogovi.model.Person;

public class BSession extends WebSession {

    private static final long serialVersionUID = -4771766482576722308L;

    private Person person = null;
    private String uploadFileName;
    private BlogType favouriteBlogType;

    private Person followFilter;
    private boolean followFilterRead = false;

    public static BSession get() {
        return (BSession) Session.get();
    }

    public BlogType getFavouriteBlogType() {
        return favouriteBlogType;
    }

    public void setFavouriteBlogType(BlogType favouriteBlogType) {
        this.favouriteBlogType = favouriteBlogType;
    }

    public BSession(Request request) {
        super(request);
    }

    public Person getPerson() {
        return person;
    }

    public void setPerson(Person person) {
        this.person = person;
    }

    public String getUploadFileName() {
        return uploadFileName;
    }

    public void setUploadFileName(String uploadFileName) {
        this.uploadFileName = uploadFileName;
    }

    public Person getFollowFilter() {
        return followFilter;
    }

    public void setFollowFilter(Person followFilter) {
        this.followFilter = followFilter;
    }

    public boolean isFollowFilterRead() {
        return followFilterRead;
    }

    public void setFollowFilterRead(boolean followFilterRead) {
        this.followFilterRead = followFilterRead;
    }

    public boolean isLoggedIn() {
        return person != null;
    }
}
